<script src="<?php echo $baseurl?>public/theme/analytics/datetimepicker/jquery.datetimepicker.js" type="text/javascript" ></script>
<link href="<?php echo $baseurl?>public/theme/analytics/datetimepicker/jquery.datetimepicker.css" type="text/css" rel="stylesheet" /> 


<div class="inside">
  <aside class="navigationPanel">
     
     <div class="tree pagesLinks">
        <ul>
           <ul>
              <li> <a href="<?php echo $baseurl.'campaign-user.html'?>" >Chiến dịch của bạn</a> </li>                      
              <li> <a class="active" href="<?php echo $baseurl.'add-campaign-user.html'?>">Tạo chiến dịch mới</a> </li>
              <li> <a href="<?php echo $baseurl.'history-trade.html'?>">Lịch sử giao dịch</a> </li>
           </ul>
        </ul>
     </div>
  </aside>
  <div class="contentPanel">
     <div class="pages" id="profile">
        <div class="profile-edit-form">
              <?php $att = array('id' => '', 'class' => '');echo form_open('', $att);?>
              <div class="contentBox switcher" style="height: 100%;">
                 <h3>Thông tin chiến dịch</h3>
                 <?php if(validation_errors()):?>
                    <h4>
                        <p><?php echo validation_errors(); ?></p>
                    </h4>
                    <?php endif;?>
                 <div class="contentSwitcher hide" style="display: block;">
                    <div class="insideContentBox">
                      
                      <label for="frm-address">Kiểu quảng cáo*:</label> 
                       <div class="custom-line" style="width: 320px;">
                           <span>
                                <select name="type_ads" class="form-select gv-select-option type_ads">
                                    <option value="0">Chọn kiểu quảng cáo</option>
                                    <option value="1">Quảng cáo fanpage facebook</option>
                                    <option value="2">Quảng cáo banner</option>
                                    <option value="3">Quảng cáo cài đặt ứng dụng di động</option>
                                    <option value="4">Quảng cáo survey</option>
                                </select>
                           </span>
                       </div>

                        <label>Địa điểm*:</label>
                        <div class="checkArea">
                            <?php $i = 1; foreach ( $dataListShop AS $el=>$le ){ ?>
                                <div class="checkLine">
                                    <span class="checkBox">
                                        <input type="checkbox" name="address_id[]" value="<?php echo $le->id;?>" id="checkBox_<?php echo $i;?>">
                                        <label class="check" for="checkBox_<?php echo $i;?>"></label>
                                    </span>
                                    <span><?php echo $le->shopName .' - ' .$le->address ;?></span>
                                </div>
                            <?php $i++; } ?>
                        </div>
					  
                       <label for="frm-fullname">Tên chiến dịch*:</label> 
                       <input type="text" name="title" value="<?php echo $this->input->post('title');?>" class="ipt" autocomplete="off" id="frm-fullname" placeholder="Tên chiến dịch...">
                       
                       <label for="frm-mobile">Thời gian bắt đầu*:</label> 
                       <input id="datetimepicker" type="text" name="time_start" value="<?php echo $this->input->post('time_start');?>" class="ipt" placeholder="Thời gian bắt đầu..." />
                       
                       <label for="frm-email">Thời gian kết thúc*:</label> 
                       <input id="datetimepicker2" type="text" name="time_end"  value="<?php echo $this->input->post('time_end');?>" class="ipt" placeholder="Thời gian kết thúc..." />
                       
                       <label for="frm-fullname">Số tiền bạn bỏ ra chi phí cho chiến dịch này*:</label> 
                       <input type="text" name="cost" value="<?php echo $this->input->post('cost');?>" class="ipt" autocomplete="off" id="frm-fullname" placeholder="Số tiền bạn bỏ ra chi phí cho chiến dịch này..."/>
                       
                       <label for="frm-address">Kiểu hiển thị*:</label> 
                       <div class="custom-line" style="width: 320px;">
                           <span>
                                <select name="oneview" class="form-select gv-select-option ">
                                    <option value="1">Hiển thị 1 lần</option>
                                    <option value="0">Hiển thị nhiều lần</option>
                                </select>
                           </span>
                       </div>
                       
                       <label for="frm-fullname">Yêu cầu khác</label> 
                       <textarea name="note" rows="4" cols="50" autocomplete="off" id="frm-fullname" placeholder="Yêu cầu khác..."><?php echo $this->input->post('note');?></textarea>
                        
                       <div class="lineButton">
                           <button type="submit" class="applyBtn btn btn-small btn-primary"><span>Tạo mới</span></button>
                           <button type="button" onclick="window.location='<?php echo $baseurl.'campaign-user.html'?>'" class="cancelBtn btn btn-default btn-small"><span>Hủy bỏ</span></button>
                       </div>
                       
                    </div>
                 </div>
                  
                 
              </div>
              
           </form>
        </div>
     </div>
  </div>
</div> 
<style>
body.flash-permanent .contentPanel {
    padding: 100px 0px 18px !important;
}
.cfr {
    line-height: 1px !important;padding: 15px 79px 0px 12px !important;height: 37px !important;
}
</style>
<script>

$('#datetimepicker').datetimepicker({
dayOfWeekStart : 1,
lang:'vi',
disabledDates:['1986/01/08','1986/01/09','1986/01/10'],
startDate:	'2015/01/01'
});
$('#datetimepicker').datetimepicker({value:'2015/01/01 00:00',step:15});
$('#datetimepicker2').datetimepicker({
dayOfWeekStart : 1,
lang:'vi',
disabledDates:['1986/01/08','1986/01/09','1986/01/10'],
startDate:	'2015/01/01'
});
$('#datetimepicker2').datetimepicker({value:'2015/01/01 00:00',step:15});

</script>
<script>
$('.type_ads').change(function(){
    var type = $('.type_ads').val();
    if( type != '0' || type != 0 ){
        $.ajax({
        type:"GET",
        url: '<?php echo $baseurl;?>ajax-get-cost-shop',
        data:{   
            type : type
		},
        success:function(data){
            var _data = JSON.parse(data);
            var html = '';
            if( _data.length > 0 ){
                for ( var i = 0; i < _data.length; i++){
                    //html += _data[i].campaign_title';
                    html += '<div class="checkLine">\n\
                    <span class="checkBox">\n\
                        <input type="checkbox" name="address_id[]" value="'+_data[i].id+'" id="checkBox_'+i+'"/>\n\
                        <label class="check" for="checkBox_'+i+'"></label>\n\
                    </span>\n\
                    <span>'+_data[i].shopName+' - '+_data[i].address+' ( Chi phí '+_data[i].cott+' VNĐ/1 lượt hiển thị )</span>\n\
                    </div>';
                }
                $('.checkArea').html(html);
		}
        }
    }); 
    }
    
});
</script>